#include "ProductionTask.h"

ProductionTask::ProductionTask(int pTaskId, int pPowerLevel, int pTimeToComplete)
{
	taskId = pTaskId;
	powerLevel = pPowerLevel;
	timeToComplete = pTimeToComplete;
}

bool ProductionTask::isCompleted()
{
	if(timeToComplete <= 0)
	{
		return true;
	}
	return false; 
}

double ProductionTask::getTimeToComplete(){return timeToComplete;}

void ProductionTask::setTimeToComplete(double pTimeToComplete)
{
	timeToComplete = pTimeToComplete;
}

string ProductionTask::getTaskName()
{
	return PRODUCTION_TASK_NAMES[taskId];
}

int ProductionTask::getTaskId(){return taskId;}

int ProductionTask::getPowerLevel() { return powerLevel; }

int ProductionTask::getProgress() 
{
	return (int)((timeToComplete/initialTime) * 100);
}